package com.demo.studentmanager.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.studentmanager.dao.AttendanceMapper;
import com.demo.studentmanager.dto.AttendanceListDto;
import com.demo.studentmanager.dto.AttendanceUpdDto;
import com.demo.studentmanager.entity.Attendance;
import com.demo.studentmanager.service.IAttendanceService;
import com.demo.studentmanager.vo.AttendanceVo;
import org.springframework.stereotype.Service;

/**
 * @author lzx
 */
@Service
public class AttendanceServiceImpl extends ServiceImpl<AttendanceMapper, Attendance> implements IAttendanceService {

    @Override
    public IPage<AttendanceVo> getAutendanceStatus(AttendanceListDto attendanceListDto) {
        Page<AttendanceVo> page = new Page<>(attendanceListDto.getCurrent(), attendanceListDto.getSize());
        return baseMapper.getAutendanceStatus(page, attendanceListDto);
    }

    @Override
    public void updateStatus(AttendanceUpdDto upDto) {
        baseMapper.updateStatus(upDto);
    }


}
